#ifndef __KBD_H
#define __KBD_H

//built in keyboard flags for the driver
#define KBD_ECHO    0x01
#define KBD_READ    0x02
#define KBD_SHIFT   0x04



#define KB_ESC   0x01  
#define KB_1     0x02
#define KB_2     0x03
#define KB_3     0x04
#define KB_4     0x05
#define KB_5     0x06
#define KB_6     0x07
#define KB_7     0x08
#define KB_8     0x09
#define KB_9     0x0A
#define KB_0     0x0B
#define KB_UNDERSCORE     0x0C
#define KB_EQUALS         0x0D
#define KB_BACKSPACE      0x0E
#define KB_TAB            0x0F
#define KB_Q     0x10
#define KB_w     0x11
#define KB_E     0x12
#define KB_R     0X13
#define KB_T     0x14
#define KB_Y     0X15
#define KB_U     0x16
#define KB_I     0X17
#define KB_O     0x18
#define KB_P     0X19
#define KB_LBRACKET     0x1A
#define KB_RBRACKET     0x1B
#define KB_ENTER        0x1C
#define KB_LCTRL        0x1D      
#define KB_A     0X1E
#define KB_S     0X1F
#define KB_D     0X20
#define KB_F     0X21
#define KB_G     0X22
#define KB_H     0X23
#define KB_J     0X24
#define KB_K     0X25
#define KB_L     0X26
#define KB_SEMI      0X27
#define KB_QUOTE     0X28
#define KB_TILDE     0X29
#define KB_LSHIFT    0X2A
#define KB_BSLASH    0X2B
#define KB_Z     0X2C
#define KB_X     0X2D
#define KB_C     0X2E
#define KB_V     0X2F
#define KB_B     0X30
#define KB_N     0X31
#define KB_M     0X32
#define KB_COMMA        0X33
#define KB_PERIOD       0X34
#define KB_SLASH        0X35
#define KB_RSHIFT       0X36
#define KB_TIMES        0X37
#define KB_LALT         0X38
#define KB_SPACE        0X39
#define KB_CAPSLOCK     0X3A
#define KB_F1           0X3B
#define KB_F2           0X3C
#define KB_F3           0X3D
#define KB_F4           0X3E
#define KB_F5           0X3F
#define KB_F6           0X40
#define KB_F7           0X41
#define KB_F8           0X42
#define KB_F9           0X43
#define KB_F10          0X44
#define KB_NUMLOCK      0X45
#define KB_SCROLLLOCK   0X46
#define KB_HOME         0X47
#define KB_DOWN         0X48
#define KB_PGUP         0X49
#define KB_DASH         0X4A
#define KB_LEFT         0X4B
#define KB_KPAD_5       0X4C
#define KB_RIGHT        0X4D
#define KB_KPAD_PLUS    0X4E
#define KB_END          0X4F
#define KB_UP           0X50
#define KB_PGDOWN       0X51
#define KB_INSERT       0X52
#define KB_DEL          0X53
#define KB_F11          0X57
#define KB_F12          0X58 


// add this to scan code if key was released
#define KEY_RELEASE_N      0x80


void kbd_isr();
int kbd_read(u8*, int);
void init_kbd();


#endif
